package com.byt.patient.api;

import com.byt.netapi.ApiBase;
import com.byt.netapi.bean.ResponseBean;
import com.byt.netapi.observer.BaseObserver;

import java.util.List;
import java.util.Map;

/**
 * 接口名称：RApi
 * 接口描述：Api
 */
public final class RApi extends ApiBase {

    private static volatile RApi instance = null;

    private RApiInterface mRApiInterface;

    private RApi() {
        super("");
        mRApiInterface = retrofit.create(RApiInterface.class);
    }

    public static RApi getInstance() {
        if (instance == null) {
            synchronized (RApi.class) {
                if (instance == null) {
                    instance = new RApi();
                }
            }
        }
        return instance;
    }

    /**
     * 获取数据
     */
    public void obtainListData(BaseObserver<ResponseBean<List<String>>> observer, Map<String, Object> requestMap) {
        ApiSubscribe(mRApiInterface.obtainListData(requestMap), observer);
    }
}